//
//  ZLFeedbackUtils.m
//
//  Created by Jiaozl on 2021/4/21.
//  
//

#import "ZLFeedbackUtils.h"

@interface ZLFeedbackUtils ()

@end

@implementation ZLFeedbackUtils

+ (void)executeLightFeedback {
    if (@available(iOS 10.0, *)) {
        UIImpactFeedbackGenerator *refreshFeedBack = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight];
        [refreshFeedBack prepare];
        [refreshFeedBack impactOccurred];
    }
}

+ (void)executeScaleClick:(UIView *)clickedView {
    if (![clickedView isKindOfClass:UIView.class]) {
        return;
    }
    CAKeyframeAnimation *animation = [CAKeyframeAnimation animation];
    animation.keyPath = @"transform.scale";
    animation.values = @[@1.0, @0.7, @1.0];
    animation.duration = 0.15;
    animation.calculationMode = kCAAnimationCubic;
    [clickedView.layer addAnimation:animation forKey:nil];
}

@end
